
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module timer
* @author: Hjava
* @description: 获取校准后时间，校准模块在timeCalibration中，通过userData进行数据传递。
* @since: 2018-07-18 21:29:36
*/
var userData_1 = __webpack_require__(/*! _util/userData */ "./src/core/utils/userData.ts");
var Timer = /** @class */ (function () {
    function Timer() {
        this._lastCts = 0;
        this._OFFSET = 3 * 60 * 1000;
    }
    Timer.prototype.get = function () {
        var deltaT = userData_1.default.get('deltaT') || 0;
        var cts = new Date().getTime() + deltaT;
        // 只处理冗余时间内的消息
        if (this._lastCts - this._OFFSET < cts && cts < this._lastCts) {
            cts = this._lastCts + 1;
        }
        this._lastCts = cts;
        return this._lastCts;
    };
    return Timer;
}());
exports.default = new Timer();


//# sourceURL=webpack://MTDX/./src/core/utils/timer.ts?